package com.asialjim.wechat.apiservice;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.http.entity.ContentType;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: ApiWrapper ]</i></h2><strong>
 * <p> api wrapper
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/3/2   &nbsp;&nbsp; JDK 8
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiWrapper implements Api {

    private String uri;
    private String name;
    private HttpMethod httpMethod;
    private ContentType responseContentType;
    private Class<? extends ApiRequest.RequestUrlParam> urlParamClass;
    private Class<? extends ApiRequest.RequestBodyParam> bodyParamClass;
    private Class<?> responseClass;

    public ApiWrapper(Api api){
        this.uri = api.getUri();
        this.name = api.getName();
        this.httpMethod = api.getHttpMethod();
        this.responseContentType = api.getResponseContentType();
        this.urlParamClass = api.getUrlParamClass();
        this.bodyParamClass = api.getBodyParamClass();
        this.responseClass = api.getResponseClass();
    }
}